home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / OS2 / V15N04.ZIP / WARPCA.ZIP / WCABSRC.ZIP / OS2API.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-18  |  7.5 KB  |  273 lines

  1. // OS2API.H -- Call's to OS/2 API, normally disguised by OWL PM classes.
  2.  
  3. #if !defined(_OS2API_H)
  4. #define _OS2API_H
  5.  
  6. #ifdef __cplusplus
  7.     extern "C" {
  8. #endif
  9.     #define SPTR_FILE                  19
  10.    #define SPTR_FOLDER                20
  11.     #define SPTR_MULTFILE              21
  12.  
  13.     #define DM_DROP                0x032f
  14.    #define DM_DRAGOVER            0x032e
  15.     #define DM_DRAGLEAVE           0x032d
  16.    #define DM_DROPHELP            0x032c
  17.     #define DM_ENDCONVERSATION     0x032b
  18.    #define DM_PRINT               0x032a
  19.    #define DM_RENDER              0x0329
  20.    #define DM_RENDERCOMPLETE      0x0328
  21.     #define DM_RENDERPREPARE       0x0327
  22.    #define DM_DRAGFILECOMPLETE    0x0326
  23.     #define DM_EMPHASIZETARGET     0x0325
  24.    #define DM_DRAGERROR           0x0324
  25.    #define DM_FILERENDERED        0x0323
  26.    #define DM_RENDERFILE          0x0322
  27.     #define DM_DRAGOVERNOTIFY      0x0321
  28.    #define DM_PRINTOBJECT         0x0320
  29.     #define DM_DISCARDOBJECT       0x031f
  30.  
  31.    #define DOR_NODROP             0x0000   /* DM_DRAGOVER response codes */
  32.    #define DOR_DROP               0x0001
  33.     #define DOR_NODROPOP           0x0002
  34.    #define DOR_NEVERDROP          0x0003
  35.  
  36.     #define SV_CXBORDER                26
  37.     #define SV_CYTITLEBAR              30
  38.     #define SV_CXICON                  38
  39.     #define SV_CYICON                  39
  40.  
  41.     #define EM_SETTEXTLIMIT            0x0143
  42.  
  43.     LONG APIENTRY WinQuerySysValue(HWND hwndDesktop,
  44.                                              LONG iSysValue);
  45.  
  46.     typedef VOID *MPARAM;    /* mp    */
  47.     typedef VOID *MRESULT;   /* mres  */
  48.  
  49.     typedef VOID *PVOID;
  50.  
  51.     typedef CHAR           *PCHAR;
  52.  
  53.     MRESULT APIENTRY WinSendMsg(HWND hwnd,
  54.                                          ULONG msg,
  55.                                          MPARAM mp1,
  56.                                          MPARAM mp2);
  57.  
  58.     #define WM_SYSCOLORCHANGE        0x002b
  59.     #define WM_MINMAXFRAME        0x0046
  60.  
  61.    #define FS_ICON                    0x00000001L
  62.  
  63.     typedef LHANDLE   HPS;         /* hps  */
  64.  
  65.     typedef struct _RECTL          /* rcl */
  66.     {
  67.         LONG  xLeft;
  68.         LONG  yBottom;
  69.         LONG  xRight;
  70.         LONG  yTop;
  71.     } RECTL;
  72.     typedef RECTL *PRECTL;
  73.  
  74.     typedef struct _OWNERITEM    /* oi */
  75.     {
  76.         HWND    hwnd;
  77.         HPS     hps;
  78.         ULONG   fsState;
  79.         ULONG   fsAttribute;
  80.         ULONG   fsStateOld;
  81.         ULONG   fsAttributeOld;
  82.         RECTL   rclItem;
  83.         LONG    idItem; /* This field contains idItem for menus, iItem for lb. */
  84.         ULONG   hItem;
  85.     } OWNERITEM;
  86.     typedef OWNERITEM *POWNERITEM;
  87.  
  88.     #define MM_SETITEMATTR             0x0192
  89.     #define MIA_CHECKED                0x2000
  90.     #define MIA_DISABLED               0x4000
  91.     #define HWNDFROMMP(mp)             ((HWND)(mp))
  92.     #define MPFROM2SHORT(s1, s2)       ((MPARAM)MAKELONG(s1, s2))
  93.  
  94.     #define WinCheckMenuItem(hwndMenu, id, fcheck) \
  95.     ((BOOL)WinSendMsg(hwndMenu, MM_SETITEMATTR, \
  96.     MPFROM2SHORT(id, TRUE), \
  97.     MPFROM2SHORT(MIA_CHECKED, (USHORT)(fcheck) ? MIA_CHECKED : 0)))
  98.  
  99.     #define WinEnableMenuItem(hwndMenu, id, fEnable) \
  100.     ((BOOL)WinSendMsg(hwndMenu, MM_SETITEMATTR, \
  101.     MPFROM2SHORT(id, TRUE), \
  102.     MPFROM2SHORT(MIA_DISABLED, (USHORT)(fEnable) ? 0 : MIA_DISABLED)))
  103.  
  104.     typedef VOID *MPARAM;              /* mp    */
  105.  
  106.     #define MPFROMP(p)                 ((MPARAM)((ULONG)(p)))
  107.     #define MPFROMSHORT(s)             ((MPARAM)(USHORT)(s))
  108.  
  109.     HAB    APIENTRY WinQueryAnchorBlock(HWND hwnd);
  110.  
  111.     BOOL APIENTRY WinShowWindow(HWND hwnd, BOOL fShow);
  112.  
  113.     BOOL APIENTRY WinEnableWindow(HWND hwnd, BOOL fEnable);
  114.  
  115.     LONG APIENTRY WinQueryWindowTextLength(HWND hwnd);
  116.  
  117.     #define FERR_DISABLEHARDERR     0x00000000L     /* disable hard error popups */
  118.  
  119.     typedef unsigned long  APIRET;
  120.  
  121.     APIRET APIENTRY DosError(ULONG error);
  122.  
  123.     typedef HWND *PHWND;
  124.  
  125.     #define FID_SYSMENU                0x8002
  126.     #define FID_MENU                   0x8005
  127.     #define FID_CLIENT                 0x8008
  128.  
  129.     HWND APIENTRY WinWindowFromID(HWND hwndParent, ULONG id);
  130.  
  131.     typedef const char          *PCSZ;
  132.  
  133.     APIRET APIENTRY  DosCopy(PCSZ pszOld, PCSZ pszNew, ULONG option);
  134.     APIRET APIENTRY  DosMove(PCSZ pszOld, PCSZ pszNew);
  135.  
  136.     BOOL APIENTRY WinSetWindowText(HWND hwnd, PCSZ pszText);
  137.  
  138.     typedef LHANDLE HPOINTER;   /* hptr */
  139.  
  140.     HPOINTER APIENTRY WinQuerySysPointer(HWND hwndDesktop,
  141.                                                      LONG iptr,
  142.                                                      BOOL fLoad);
  143.  
  144.     BOOL     APIENTRY WinDestroyPointer(HPOINTER hptr);
  145.  
  146.     #define SYSCLR_ENTRYFIELD (-47L)
  147.  
  148.     LONG APIENTRY WinQuerySysColor(HWND hwndDesktop,
  149.                                              LONG clr,
  150.                                              LONG lReserved);
  151.     #define QWL_STYLE                  (-2)
  152.     #define QW_PARENT       5
  153.  
  154.     ULONG  APIENTRY WinQueryWindowULong(HWND hwnd,
  155.                                                     LONG index);
  156.     BOOL   APIENTRY WinSetWindowULong(HWND hwnd,
  157.                                                  LONG index,
  158.                                                  ULONG ul);
  159.     HWND    APIENTRY WinQueryWindow(HWND hwnd,
  160.                                               LONG cmd);
  161.  
  162.     typedef struct _RESULTCODES
  163.     {   //
  164.         ULONG codeTerminate;      // Termination code or process ID
  165.         ULONG codeResult;         // Exit code
  166.     } RESULTCODES;
  167.  
  168.     typedef RESULTCODES *PRESULTCODES;
  169.  
  170.   typedef LHANDLE PID;            // pid
  171.   typedef PID *PPID;
  172.  
  173.   typedef ULONG *PULONG;
  174.  
  175.   typedef char          *PSZ;
  176.  
  177.   typedef struct _STARTDATA     /* stdata */
  178.   {
  179.         USHORT  Length;
  180.         USHORT  Related;
  181.         USHORT  FgBg;
  182.         USHORT  TraceOpt;
  183.         PSZ     PgmTitle;
  184.       PSZ     PgmName;
  185.       PBYTE   PgmInputs;
  186.       PBYTE   TermQ;
  187.       PBYTE   Environment;
  188.       USHORT  InheritOpt;
  189.       USHORT  SessionType;
  190.         PSZ     IconFile;
  191.       ULONG   PgmHandle;
  192.         USHORT  PgmControl;
  193.       USHORT  InitXPos;
  194.         USHORT  InitYPos;
  195.       USHORT  InitXSize;
  196.       USHORT  InitYSize;
  197.       USHORT  Reserved;
  198.       PSZ     ObjectBuffer;
  199.         ULONG   ObjectBuffLen;
  200.   } STARTDATA;
  201.   typedef STARTDATA *PSTARTDATA;
  202.  
  203.   APIRET APIENTRY  DosStartSession(PSTARTDATA psd,
  204.                                                 PULONG pidSession,
  205.                                                 PPID ppid);
  206.  
  207.     #define SSF_RELATED_INDEPENDENT 0
  208.     #define SSF_RELATED_CHILD       1
  209.  
  210.     #define SSF_FGBG_FORE           0
  211.     #define SSF_FGBG_BACK           1
  212.  
  213.     #define SSF_TRACEOPT_NONE       0
  214.     #define SSF_TRACEOPT_TRACE      1
  215.     #define SSF_TRACEOPT_TRACEALL   2
  216.  
  217.     #define SSF_INHERTOPT_SHELL     0
  218.     #define SSF_INHERTOPT_PARENT    1
  219.  
  220.     /* note that these types are identical to those in pmshl.h for PROG_* */
  221.     #define SSF_TYPE_DEFAULT        0
  222.     #define SSF_TYPE_FULLSCREEN     1
  223.     #define SSF_TYPE_WINDOWABLEVIO  2
  224.     #define SSF_TYPE_PM             3
  225.     #define SSF_TYPE_VDM            4
  226.     #define SSF_TYPE_GROUP          5
  227.     #define SSF_TYPE_DLL            6
  228.     #define SSF_TYPE_WINDOWEDVDM    7
  229.     #define SSF_TYPE_PDD            8
  230.     #define SSF_TYPE_VDD            9
  231.  
  232.     /* note that these flags are identical to those in pmshl.h for SHE_* */
  233.     #define SSF_CONTROL_VISIBLE     0x0000
  234.     #define SSF_CONTROL_INVISIBLE   0x0001
  235.     #define SSF_CONTROL_MAXIMIZE    0x0002
  236.     #define SSF_CONTROL_MINIMIZE    0x0004
  237.     #define SSF_CONTROL_NOAUTOCLOSE 0x0008
  238.     #define SSF_CONTROL_SETPOS      0x8000
  239.  
  240.     BOOL     APIENTRY WinSetPointer(HWND hwndDesktop,
  241.                                               HPOINTER hptrNew);
  242.  
  243.     typedef struct _FSQBUFFER2       /* fsqbuf Data structure for QFSAttach*/
  244.     {
  245.         USHORT  iType;
  246.         USHORT  cbName;
  247.         USHORT  cbFSDName;
  248.         USHORT  cbFSAData;
  249.         UCHAR   szName[1];
  250.         UCHAR   szFSDName[1];
  251.         UCHAR   rgFSAData[1];
  252.     } FSQBUFFER2;
  253.     typedef FSQBUFFER2 *PFSQBUFFER2;
  254.  
  255.     APIRET APIENTRY  DosQueryFSAttach(PCSZ    pszDeviceName,
  256.                                                  ULONG  ulOrdinal,
  257.                                                  ULONG  ulFSAInfoLevel,
  258.                                                  PFSQBUFFER2 pfsqb,
  259.                                                  PULONG pcbBuffLength);
  260.  
  261.     APIRET APIENTRY  DosQueryCurrentDisk(PULONG pdisknum,
  262.                                                      PULONG plogical);
  263.  
  264.     APIRET APIENTRY  DosQueryCurrentDir(ULONG disknum,
  265.                                                     PBYTE pBuf,
  266.                                                     PULONG pcbBuf);
  267.  
  268.     APIRET APIENTRY  DosDeleteDir(PCSZ pszDir);
  269. #ifdef __cplusplus
  270.     }
  271. #endif
  272.  
  273. #endif